package cn.itcast.bos.web.action.base;

import java.util.List;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import cn.itcast.bos.domain.base.TakeTime;
import cn.itcast.bos.service.base.TakeTimeService;
import cn.itcast.bos.web.action.common.BaseAction;

@Controller//交给spring管理
@Scope("prototype")
@Namespace("/")
@ParentPackage("json-default")
public class TakeTimeAction extends BaseAction<TakeTime> {

	//注入业务层
	
	@Autowired
	private TakeTimeService takeTimeService;
	
	/**
	 * 查询取派时间
	 */
	@Action(value="taketime_findAll",results={@Result(name="success",type="json")})
	public String findAll(){
		
	//调用业务层处理
		List<TakeTime> list=takeTimeService.findAll();
	//将查询的数据存入值栈
		ServletActionContext.getContext().getValueStack().push(list);
		
		return SUCCESS;
	}
	
	
	
}
